<style>
td,th {
  text-align: center;
}
</style>
<?php 
//if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$i=0;
foreach($cycle_by_client_id as $cycle_by_client_id_row)
	{
		$billing_cycle[$i] = $cycle_by_client_id_row;
		$i++;
	}
?>

</br>
<div class="span12">
<h1>Project Billing Details</h1>
</div>
</br>
<?php 
 if(isset($result) OR !empty($result))
	{
		$i=0;
		foreach($project as $project_row)
			{
				echo("</br>" . "<div class=\"span4\"><h3>Project Name: ".$project_row['name']."</h3></div>");
				echo("<div class=\"span4 offset3\"><h3>Billing Cycle: ". $billing_cycle[$i] ."</h3></div>");
				$i++;
				foreach($result as $result_row)
					{
						if($project_row['id'] == $result_row['project_id'])
							{
?>
								<table width="100%" class="table table-condensed">
									<thead>
										<tr>			
											<th width="12.5%">
												Invoice ID
											</th>
											<th width="12.5%">
												Blank
											</th>
											<th width="12.5%">
												Date
											</th>
											<th width="12.5%">
												Sub-Amount
											</th>
											<th width="12.5%">
												Discount
											</th>
											<th width="12.5%">
												Tax
											</th>
											<th width="12.5%">
												Total Amount
											</th>
											<th width="12.5%">
												Status
											</th>
										</tr>
									</thead>
			
									<tbody>		
										<tr>
											<td >
												<?php echo($result_row['invoice_id']);?></a>
											</td>
											<td >
												<?php echo("Empty");?>
											</td>
											<td >
												<?php echo ($result_row['date']);?>
											</td>
											<td >
												<?php echo ($result_row['subtotal']);?>
											</td>
											<td >
												<?php echo ($result_row['discount']);?>
											</td>
											<td >
												<?php echo ($result_row['tax']);?>
											</td>
											<td >
												<?php $total = $result_row['subtotal']-$result_row['discount'];  echo ($total);?>
											</td>
											<td >
											<span class="label label-<?php  if($result_row['status']=="0") echo ("important");
																			else echo("success");?>">
																	<?php  if($result_row['status']=="0") echo ("Not Paid");
																			else echo("paid");?>
											</span>	
											</td>
										</tr>
									</tbody>		
								</table>	
<?php }
else echo("<span class=\"span10\" style=\"text-align:center\"><h3>Empty!! No Invoice Found</h3></span>");
?>
<?php }}}?>
</div>
